Error detection and correction codes are codes utilized in a wide variety of digital electronic systems to detect and correct errors in stored and communicated data. Using such codes, the value of one or several erroneous bits can be restored to a correct value or values after a storage or a transmission
FIG. 1 is a block diagram of a typical memory system 10 including memory 8 for storing data, where the term data includes any type of stored information including program instructions and data generated by or associated with such instructions. When the memory system 10 stores a data word 2, the data word is first presented to error correcting code (ECC) logic 4 before being written into the memory 8. The ECC logic 4 generates error checking and correction bits using the data word 2, and these additional error bits are then stored in memory 8 along with the data word 2. In the following description, the error detection and correction bits may be referred to as check bits, and the original data word 2 in combination with the check bits may collectively be referred to as a code word. The data word 2 and check bits are stored in specific locations in the memory 8 as programmed by redundancy logic 6 which redirects data to redundant storage locations in the memory to thereby replace defective storage locations, as will be described in more detail below. In this way, the redundancy logic 6 replaces defective storage locations to which data was initially directed with redundant storage locations, as will be understood by those skilled in the art. When data is subsequently read from the memory 8, the data is again presented to the ECC logic 4 to ensure the data as read is the same as the data word 2 initially stored in the memory.
The memory 8 is designed to maximize the number of bits available (storage capacity) without sacrificing too much memory speed (the time it takes to store or access the data). Thus, memory cells that store individual bits are packed as closely together as possible through a variety of different techniques, such as by reducing the number of transistors per memory cell and by making the transistors smaller. Typically, the smaller a memory cell the longer it takes to access the cell due to the small voltages and currents that must be properly sensed. Thus, there is a trade off in using more and larger transistors to increase the speed of the memory 8 but at the same time reducing the storage capacity of the memory. As a result, the memory system 10 typically includes a combination of relatively slow but high-capacity memory cells such as dynamic random access memory (DRAM) cells, and also includes lower-capacity but faster memory cells such as static random access memory (SRAM) cells.
An array of memory cells includes a plurality of rows and columns of memory cells, with an address being associated with each memory cell in the array. In high-capacity arrays such as those formed from DRAM cells, the address is typically divided into a column address and a row address. The row address is typically sent first, and in response to the row address the data stored in an entire row of memory cells in the array is sensed and stored in circuitry in the memory 8. The column address is provided to the memory 8 after the row address, and selected ones of the memory cells in the addressed row are selected in response to the column address. If data is being fetched from a series of consecutive column addresses within the same addressed row of memory cells, the data stored in these consecutive columns of memory cells can be accessed from the circuitry that previously sensed and stored the data of the addressed row.
The memory 8 is typically manufactured with spare or redundant bits, and the redundancy logic 6 is programmed to substitute any defective memory cells with redundant memory cells. The redundancy logic 6 is typically programmed during initial testing of the memory 8. Referring to FIG. 2, the memory 8 of FIG. 1 is considered as a memory array 12 of rows and columns of memory cells (not shown). The main approaches to the substitution of defective memory cells in the array 12 with redundant cells utilize laser blown fuses, electrical fuses, or one-time-programmable MOSFETs. Laser fuse based repair is still a common approach, although this type of repair increases test costs substantially since a 3-step test process of test, laser repair, and retest is required. Electrical fuse based repair can be performed as a single process using a tester, which tests, electrically repairs, and retests while the memory 8 is coupled to the tester.
The repair process for substituting redundant memory cells for defective memory cells typically consists of identifying the proper laser programmable fuses, electrically programmable fuses, or one-time-programmable MOSFETs needed to deactivate a defective column 14 of memory cells, deactivating the defective column or group of columns containing a defective cell or cells), activating a redundant column 16 or group of redundant columns of memory cells, and programming the redundancy logic 6 to assign the array address corresponding to the defective column 14 to the address of a redundant column 16. After the defective column 14 is disabled and the redundancy logic 6 programmed, whenever the defective column 14 is addressed the redundant column 16 will be accessed instead, allowing data to be read from and written to the memory cells in the redundant column 16. In this way, every time a subsequent read or write operation addresses the defective column 14, the redundant column 18 is accessed instead of the defective column. The circuitry, operation, and processes for redundancy programming to replace defective memory cells with redundant cells is well understood by those skilled in the art, and thus will not be described in more detail.
Modern computer systems typically contain hundreds of megabytes (MB) of memory for storing programming instructions and associated data. With so much memory now being contained in computer systems, the likelihood of defective memory cells has increased. For example, 128 MB of DRAM is a typical amount contained in present personal computer systems. Each byte of memory typically includes 8 bits and thus is stored in 8 individual memory cells. Accordingly, there are over 1×109 DRAM memory cells required to store the desired 128 MB of data. Moreover, these DRAM memory cells are typically accessed hundreds of millions of times per second. Given such a large number of memory cells and the frequency with which the cells are accessed, the probability that an error will occur in data being read from or written to the memory cells is fairly high.
As previously mentioned, the ECC logic 4 adds error bits to the stored data word 2, with the error bits being redundant information that allows errors in the data stored in the memory 8 to be detected and in some cases corrected. Referring again to FIG. 1, the ECC logic 4 performs error-correcting operations on data words 2 used by application programs (not shown) accessing the memory 8. In general, referring to FIG. 3 a typical embodiment of the ECC logic 4 is shown in more detail to describe the conventional way errors are detected and corrected. A data input signal DI, which corresponds to the data word 2 in FIG. 1, is a word M bits long and there are an additional K bits added to the word that are used to detect and correct data bit errors. An encode function 72 is the algorithm used to generate or properly set the additional K bits based upon the original M bits. After encoding of the data word DI by the encode function 72, M and K are both stored in memory 8. At some subsequent time, M and K are both read from memory 8, such as by an application program, and the read M bits are presented to a buffer 80 in a corrector unit 78 and are also presented to an encode function 74, which is identical to encode function 72 and generates K bits based on the bit values of the read M bits. The compare unit 76 compares the K bits generated by encode function 74 to the K bits read from memory 8. If the two sets of K bits have identical values the compare unit 76 signals the corrector unit 78 to release the M-bits from buffer 80 without change as a data out signal DO. If, however, the compare unit signals the corrector unit 78 that the two sets of K bits have different values, the corrector unit corrects the M bits in buffer 80 based on a correction algorithm and then releases M from buffer 80 as corrected as the data out signal DO. The compare unit 76 also generates an error signal ES in this case, which is utilized by other circuitry (not shown) in the memory system 10 (FIG. 1).
The ECC logic 4 may execute a variety of different error detection and correction algorithms. One common algorithm is an algorithm that utilizes a code known as a Hamming code, which is an error detection and correction code used in many fields. An example of a Hamming code and its use for data storage in a memory 8 will now be described in more detail for the case where the data words 2 to be stored are 16-bit words. Let X be the data word 2 to be stored. X can be represented by a vector Xe, the 16 components X0 to X15 of which correspond to the 16 bits of the data word 2 to be stored. Five error check bits C1(C0 . . . C4) are obtained by multiplying a parity control matrix H called a Hamming matrix, of dimensions 5×16, by the vector Xe in the form of a column vector.
FIG. 4A illustrates the Hamming matrix H for 16 bit data words 2 and the corresponding vectors Xe, and FIG. 4B illustrates the way to obtain the error check bits C1 by performing matrix multiplication of H*Xe. Calling hij the elements of matrix H, the error check bits C1 are given by:
            C      i        =                  ∑                  j          =          0                15            ⁢                        h          ij                *                  X          j                      ,with Xj being the jth component of vector Xe.
During a write data transfer, 21-bit words formed by the 16 data bits Xj forming the vector Xe and by the 5 check bits C1 generated from the matrix H and the vector Xe are written into the memory 8. In a read data transfer, the read word includes 16 bits Xr corresponding to the data bits read from the memory 8 and 5 bits Cr corresponding to the check bits read from the memory. It is possible for Xr and Cr not to be equal to Xe and C1, respectively, if errors have occurred between the write and read data transfer operations.
To detect and/or correct possible errors in the read bits Xr and Cr, a syndrome S with five components S0, . . . S4 is calculated by multiplying a determined matrix H′ of dimensions 5×21 by a read column vector or “read word” with 21 elements formed by the 16 bits Xr and the 5 check bits Cr.
FIG. 5A illustrates the matrix H′. The first 16 columns and all 5 rows of matrix H′ correspond to the 16 columns of matrix H as indicated by the dotted lines. The 5 following columns, namely columns 17-21 each include a single “1” on a diagonal from the top left column to the bottom right column as shown. Thus, the 17th column has its “1” in the first row, the 18th column has its “1” in the second row, and so on until the 21st column, which has its “1” in the fifth row. These last five columns of the matrix H′ form a 5×5 identity matrix and are used to determine possible errors in the check bits Cr.
FIG. 5B illustrates the calculation of a syndrome S.
If syndrome S has all its elements equal to 0, the storage of the read word formed by the 16 bits Xr and the 5 check bits Cr occurred with no errors and all the bits of the read word, be they data bits of the vector Xr or the check bits Cr, are correct.
If the syndrome S is different from 0, the read word includes one or more errors. If a single bit of the read word is erroneous, the obtained syndrome S enables correcting the error. Indeed, the syndrome S corresponds in this case to the column in the matrix H′ having had its elements multiplied by the erroneous bit. In other words, when a single bit in either the 16 bits Xr or the 5 check bits Cr is erroneous, the syndrome S will have a value corresponding to one of the columns in the matrix H′. Each column in the matrix H′ is associated with a particular one of the bits in Xr and Cr and thus the non-zero value of the syndrome indicates the erroneous bit. The matrix H′ has columns 1-21 from left to right where the bits X0-X15 and C0-C4 are associated with the columns 1-21, respectively. For example if the calculated syndrome is equal to:
      S    =          (                                    0                                                                                                0                                                                              0                                                                                          1                                                1                              )        ,then the syndrome corresponds to the first column of the matrix H′, which is associated with the first bit X0 of the vector Xr. Thus, this syndrome indicates that the first bit X0 of the vector Xr is erroneous.
Similarly, if the calculated syndrome is equal to:
            S      ″        =          (                                    1                                                                                                0                                                                              0                                                                                          0                                                0                              )        ,then the syndrome S corresponds to the 17th column in the matrix H′ which is associated with the first detection bit C0. In this example, the syndrome means that the first detection bit C0 is erroneous. By knowing the erroneous bit from the syndrome S, the erroneous bit can be corrected simply by taking the complement of that bit. For example, if the syndrome S indicates the first bit X0 of the vector Xr is erroneous, then the corrector unit 78 (FIG. 1) may correct this bit by simply inverting the value of bit, such that if the bit is a “0” it is changed to a “1” and if the bit is a “1” it is changed to a “0.”
The above-described Hamming code cannot detect two errors. Thus, if an error has occurred in bits X1 and X2, the obtained syndrome S is equal to the sum modulo 2 of the syndromes corresponding to errors on X1 and X2, that is, to:S′=(00101)+(00110)=(00011).
The obtained syndrome S′ indicates an error in bit X0, which is wrong since the errors actually occurred in bits X1 and X2.
Indeed, the above Hamming code is known to gave a minimum code distance d=3 and a linear code like the Hamming code is known to be able to correct L errors and to detect L+1 errors if its minimum code distance d is strictly greater than 2 L+1. Accordingly, for the above Hamming code L=1 and thus the code can detect two errors (e.g., in the above example of bits X1 and X2 being erroneous the syndrome S was non zero and thus indicated that an erroneous bit was present) but can correct only a single error. A linear code is a code in which the sum of two read words equals a valid read word of an overall group of read words that collectively make up the code, as will be understood by those skilled in the art. Similarly, one skilled in the art will understand that the minimum Hamming code distance is the minimum number of bits by which all pairs of read words differ for all pairs of words that collectively make up the code.
To improve the above code and allow more errors to be detected, the minimum distance of the code must be increased. For example, to convert the above code into a code having a minimum code distance d equal to 4, a total parity bit P may be added to each read word.
The total parity bit P for each read word is calculated by adding modulo 2 all the data bits X0-X15 and all the check bits C0-C4 or each read word that is part of the overall code. The total parity bit P is added to each word to be stored, and the word to be stored X0-X15 the check bits C0-C4, and the total parity bit P are all collectively stored as a word in the overall code.
In a read data transfer, the read word is multiplied by parity control matrix H″ shown in FIG. 6A. The matrix H″ has one more row and one more column than the matrix H′. The matrix H″ includes, to the top left, that is, on the first five lines and on the first 21 columns, a block identical to the matrix H′. The last row D of matrix H″ only includes “1 s” and the last column of matrix H″ only includes “0 s”, except for the last line row which in the row D and is therefore a “1.”
The obtained syndrome S′ is illustrated in FIG. 6B and has six components S0 to S5 obtained by multiplying the matrix H″ by a column vector formed by the 22 bits of the read word. The 22 bits in the read word are the 16 read data bits Xr, followed by the five read check bits Cr, and finally the read total parity bit Pr. The code obtained using the matrix H″ is a so-called “Single Error Correction”-“Double Error Detection” (“SEC-DED”) code. This code has a minimum code distance d equal to four and can detect two errors in all cases, two errors being indicated by the fact that the last component of the syndrome, S5, is zero while the syndrome S is different from the zero vector.
While the above SEC-DED code allows single errors to be corrected and double errors to be detected, the calculation of the total parity bit P is required. This calculation requires a large number of adders, since all data bits Xr and check bits Cr must be added modulo 2. Further, the calculation of the total parity bit P cannot be performed in parallel with the calculation of the check bits Cr, since it requires the previous knowledge of the check bits. Accordingly, it must be awaited that all check bits Cr have been calculated to calculate total parity bit P, which wastes time.
Upon decoding, the calculation of the last syndrome element, S5, requires a large number of additional adders, and this increases the circuitry required for decoding each stored read word which, in turn, increases the area consumed by such decoding circuitry in an integrated circuit. Furthermore, since each addition requires some time, the calculation of the last syndrome element S5 has a relatively long duration and thus undesirably increases the overall decoding time of each read word. This is true of the sixth row of matrix H″ in particular because this row consists of all binary “1”s, and each binary “1” requires an associated adder circuit while a binary “0” in the matrix does not require such an adder circuit, as will be understood by those skilled in the art and as will be discussed in more detail below.
It should also be noted that, in the above-described Hamming code, the Hamming matrix is neither symmetrical, nor regular. Thus, considering that the elements of a column in the matrix H″ correspond to the binary representation of a number, the variation of this number is not regular from column to column but instead includes jumps. This makes difficult the forming of a circuit implementing the parity control matrix H″ as well as the syndrome S decoding.—Systems have been developed using parity control matrices having characteristics that simplify circuitry for implementing the matrix and associated syndrome. For example, FIG. 7A illustrates an example of a parity control matrix M for calculating the check bits C for 16-bit read words in an error correction/detection code. The number of check bits C is equal to 6 and matrix M is a matrix of dimension 6×16. Each column of matrix M is different from every other column and the columns are linearly independent two by two. Furthermore, each column of matrix M is complementary to an immediately adjacent column, except for the first two columns.
The matrix M can be decomposed into eight couples Ai of two adjacent columns, with i ranging from 0 to 7. The couple A0 corresponds to the columns of rank 0 and of rank 1, couple A1 to the columns of rank 2 and of rank 3, and so on through couple A7 to the columns of ranks 14 and 15. In the example of matrix M shown in FIG. 7A, the two columns of a couple Ai are complementary, except for couple A0. The couples A1 to A7 of the matrix M are formed as follows. The first four elements of the first column of a couple correspond to the binary representation of rank i of the couple Ai. Thus, the first column of couple A3 has its first four elements equal to “0011”, which is the binary representation of the number 3.
The first four elements of the first column of couple A0 (column of rank 0) are chosen to be equal to “0011”. This choice is not critical. The first four elements of the column of rank 0 may indeed have any value, provided that the column of rank 0 once completed is different from any other column of matrix M or from the columns relative to the check bits of the matrix used for the decoding, M′, which will be described hereafter. The choice of (“0011”) has the advantage of using a small number of binary “1s”, which simplifies the coding and decoding circuits for implementing the matrix M because, as previously mentioned, the number of binary “1s” determines the number of adders required in the coding and decoding circuits. The last two elements of each first column of a couple Ai (columns of even rank) are equal to “10”, except for the first and last couples Ai (columns of rank 0 and 14), where they are equal to “01”.
Except for the first couple, A0, each second column of a couple Ai is complementary to the first column of the couple. In other words, except for the column of rank 1, the elements of each column of odd rank are the complements of the elements of the immediately preceding column of even rank, and vice versa. For example, the elements of the first column (rank 8) of couple A4 are equal to “010010” and the elements of the second column (rank 9) of this couple are “101101”. In FIG. 7A, couple A0 has “001101” as its first column and “111110” as its second column.
It should be noted that the penultimate row of matrix M, referred to as K, having as elements “0110101010101001”, is complementary to the last row of matrix M, referred to as L, having as elements “1001010101010110”. This provides advantages when calculating a total parity bit, as will be described in more detail below.
When matrix M is multiplied by a column vector of sixteen components X0-X15 corresponding to the bits of the word to be coded and six check bits C0-C5 are obtained, which are added to the word to be coded to form a 22-bit coded word. FIG. 7B illustrates a matrix M′ used for the decoding the 22-bit coded word to generate the corresponding syndrome S. At decoding, a vector having 22 components, corresponding to the 22 bits of the coded word being decoded (16 data bits X0-X15 and 6 check bits C0-C5 after any processing, for example, a storage of the coded word in memory or a transmission of the coded word), is multiplied by matrix M′ to form a syndrome S having six components S0-S5. The matrix M′ is a matrix of dimension 6×22 with the first sixteen columns forming a block identical to the matrix M. The first five rows of the five next columns (ranks 16 to 20) form a block A of dimension 5×5 that is an identity matrix having “1s” on a main diagonal and “0s” elsewhere. Under block A, the elements of the last row of the columns of rank 16 to 20 are chosen to be equal to “11110”, to correspond to the inverses of the elements of the last row of block A (“00001”). The last column of matrix M′, which enables correcting an error on the sixth detection bit C5, includes “0s” in the first five rows and a “1” in the last row.
In the matrix M′, the columns corresponding to the data bits (i.e., ranks 0-15 of the block corresponding to the matrix M) are complementary two by two, except for the first two, . Further, the last two rows of the matrix M′ are also complementary. If the sum modulo 2 of the last two syndrome components, S4 and S5, is calculated, the sum modulo 2 of all the data bits and the check bits of the word to be decoded, that is, a total parity bit Pr is obtained. The total parity bit Pr is here simply obtained and is calculated in approximately half the time as in the case of the corresponding Hamming code previously discussed with reference to the matrix H″ of FIG. 6B. Further, upon coding, in contrast to the Hamming code using the matrix H″, no total parity bit P is calculated.
If the syndrome S is equal to the zero vector, there are no errors, either in data bits X0-X15 or in the 6 check bits C0-C5. If the syndrome S is different from the zero vector and total parity bit Pr is equal to 1, this means that there has been a single error, which can be corrected. Indeed, the syndrome S elements in this case correspond to the elements of the column of matrix M′ corresponding to the erroneous bit. If the syndrome is different from the zero vector and total parity bit Pr is equal to 0, two errors are present, which are detected but which cannot be corrected since it is not known which two columns of matrix M′ correspond to the erroneous bit in the data bits X0-X15 or in the 6 check bits C0-C5.
FIG. 8A schematically shows the principle of a circuit used for the coding the data bits X0-X15 to thereby calculate the check bits C0-C5. A coding circuit 100 includes 16 inputs E0 to E15, which receive the 16 data bits X0 to X15 of the word to be coded. The circuit 100 also includes 6 outputs C0 to C5 providing the six check bits. Each input E is connected to a column of rank i of the circuit 100 and each output Cj is connected to a row of rank j of the circuit. An adder modulo 2 Gi,j schematically indicated herein by a circle marked with a cross may be present at the intersection of column i and of row j in the circuit 100. The adders modulo 2 Gi,j may be any adders, and formed for example by XOR gates.
An embodiment of one of the adders modulo 2 Gi,j is shown in FIG. 8B and includes two inputs ei,j1 and ei,j2 often respectively called e1 and e2 hereafter for ease of reference. The input e1 is connected to input E1 and input e2 receives the signal present on row j to the left of adder Gi,j. The adder Gi,j also includes an output si,j located on row j to the right of adder Gi,j, which will simply be referred to as s hereafter. When there is no adder Gi,j at the intersection of column i and row j, column i and row j cross with no influence upon each other. This means that the bit X0-X15 provided to the concerned input E0-E15 is not used to calculate the corresponding detection bit Cj, which simplifies the circuitry required to form the circuit 100. An additional column, a (FIG.8A), located to the left of the column of rank 0 connects input e2 of each first adder Gi,j of a row to ground GND.
The operation of circuit 100 will be explained for the calculation of detection bit C4, corresponding to the row of rank 4. Starting from the left, the first encountered adder is adder G1,4. The input e2 of adder G1,4 is grounded via column a and the input e1 of adder G1,4 receives data bit X1 via input E1 of the circuit 100. At the output of adder G1,4, s=0⊕X1, which is equal to X1. The signal provided by adder G1,4 is applied to the input e2 of adder G2,4 in the next adjacent column to the right, and this adder calculates the value X1⊕X2. This process continues from left to right for the adders Gi,j in the row of rank 4, until the adder G15,4 performs the addition modulo 2 of the result provided by adder G12,4 and the data bit X15. Thus, C4=X1⊕X2⊕X4⊕X6⊕X8⊕X10⊕X12⊕X15, which corresponds to the multiplication of the fifth row of matrix M by a vector having as elements the bits X0-X15 of the word being coded. Generally speaking, the circuit 100 has the structure of matrix M with the circuit rows and columns corresponding to the rows and columns of matrix M, and an adder modulo 2 Gi,j being located in each row where the matrix M includes a “1”. In other conventional encoder circuits, an adder Gi,j is formed for each element in the matrix M and thus is located at an intersection of each row and column.
The advantages provided for the circuit 100 by the fact that adjacent columns of the matrix M are complementary will now be described. Because the columns of the matrix M are complementary except for the first two columns, the adders modulo 2 Gi,j of circuit 100 need not be formed in adjacent columns except possibly for the first two columns rank 0 and 1. As a result, each adder Gi,j can laterally (i.e., in the direction of the rows) occupy the place of two adders in prior art circuits requiring an adder at the junction of each row and column. Making the adders Gi,j larger means components forming the adders, such as transistors, can be physically larger so that the overall operation of the adder is faster. This is desirable because the circuit 100 slows the rate at which code words can be encoded and decoded and thereby lowers the throughput of the data bits X0-X15, which is the data being accessed or communicated.
FIG. 8C illustrates the row of rank 4 of the circuit 100, which generates the detection bit C4. Each adder Gi,j in this row is shown in the form of a rectangular block. The first adder Gi,j encountered is adder G1,4 with its input e2 grounded via column a and its input e1 receiving bit X1 via input E1. In FIG. 8C, the columns of the circuit 100 that are not connected to an input of an adder Gi,j of the row of rank 4 are shown as dotted lines. The output si,j of each of the adders Gi,j supplies the input e2 of the next adjacent adder to the right, and the last adder G15,4 provides the detection bit C4 of the circuit 100. The row of rank 4 of the coding circuit 100 thus includes eight adders (G1,4, G2,4, G6,4, G8,4, G10,4, G12,4, and G15,4), with the data bits being used to calculate the detection bit C4 being X1, X2, X4, X6, X8, X10, X12, and X15. All the adders Gi,j of the row of rank 4 have a double surface area as compared to prior adders that had to be positioned at the intersection of each row and column of the matrix M.
Although in FIG. 8C, the input e1 of an adder Gi,j is located either to the left, or to the right of the adder, all circuit adders may have the same physical structure. In this case, each input e1 is arranged at a same determined location of an adder Gi,j such that a set of vias or connections can couple the input to the desired input E to supply the required bit X. The circuit 100 is thus formed of 48 adders Gi,j (8 adders per line), all having a same silicon surface area, which is twice that provided by adders positioned at the intersection of each row and column. Furthermore, due to the fact that the coding matrix M has two complementary lines, no total parity bit P is ever calculated upon coding. The 6 check bits C0 to C5 may be calculated in parallel and added to the word X being coded with no additional time loss, as is the case when generation of the total parity bit P is used.
FIG. 9 schematically shows a decoding circuit 110 used for decoding code words formed by the bits X′0 to X′15 and the six check bits C′0 to C′5. The circuit 110 includes 22 inputs E′0 to E′21 receiving the 22 bits of the word to be decoded (16 data bits X′0 to X′15 and 6 check bits C′0 to C′5). The circuit 110 includes six outputs S0 to S5, each providing a component of a generated syndrome S. The circuit 110 shown herein is directly made at the output of a memory, of which only a row 12 of 22 sense amplifiers SA0 to SA21 is shown. The sense amplifiers SAi are each located at the end of a bit line (not shown) and at the end of two complementary bit lines for a DRAM (not shown), and each sense amplifier provides a bit X′0 to X′15 of the word X′ to be decoded. The sense amplifiers SA0 to SA15 provide data bits X′0 to X′15 and sense amplifiers SA16 to SA21 provide check bits C′0 to C′5. The decoding circuit 110 is formed on the same silicon chip as the memory (not shown) in which the coded word including bits X′0 to X′15 and C′0- C′5 is stored, and may be an integral part thereof. Each of the inputs E′i of the circuit 110 is spaced apart from another input by the interval separating two sense amplifiers SAi.
An examination of FIG. 9 shows that almost all adders Gi,j of the decoding circuit 110 occupy a surface area which is double that provided by other adders as previously discussed, and adders of double surface area can operate much faster than adders having half their surface area and thereby the decoding circuit operates much faster.
It should further be noted that the number of adders Gi,j per row is reduced as compared to prior circuits, resulting in an additional increase in operating speed of the decoding circuit 110. As a comparison, reference will be made to the last row of matrix H″ of FIG. 6A, formed of 22 consecutive “1s”. Thus, the last row of the corresponding decoding circuit must include 22 small adders Gi,j connected in series. In contrast, with the matrix M′ the last row of the decoding circuit 110 only includes 13 adders Gi,j, 9 of which have a surface area which is double that of the adders that would be utilized to implement the matrix H″. The increased operating speed of the circuit 100 is thus present at two levels: 1) physically larger and thus faster adders Gi,j; and 2) fewer adders per row and thus reduced operating time of these series-connected adders. Since the overall calculation time of the decoding circuit 110 corresponds to the sum of the processing times for each of the adders Gi,j, the circuit operates much faster than a decoding circuit implementing the matrix H″ and including many more adders connected in series. Furthermore, the larger surface area of the adders Gi,j enables them to operate more reliably.
The code words X, C for the encoding circuit 100 of FIG. 8A and decoding circuit 110 of FIG. 9 are not limited to codes intended for 16-bit data words X0 to X15. Indeed, it is possible to define codes enabling the coding words X having any number of bits, as long as at least two consecutive columns are complementary to thereby enable reducing the processing time of the adders for by these columns. For example, it is possible to generalize matrix M of FIG. 7A to code any data word X including an even number of m bits. The number r of check bits C must be at least greater by 2 than the number necessary to binarily represent the number of bits of the word X to be coded. Preferably, r will be equal to its minimum value, to minimize the number of bits required for the code and thereby avoid making the code too “heavy”. Thus, when m is equal to 16, four bits are required to binarily represent sixteen possibilities and r is chosen to be equal to 6, as seen previously. For m=32, the number of check bits is chosen to be equal to 7, with there being 5 bits to binarily represent the 32 bits in each word X being coded plus the two additional bits. As another example, for m=128 the number of check bits is equal to 9, with 7 bits representing the 128 bits in each word X being coded plus the two additional bits. The same process applies to words X having any number of bits m, as will be understood by those skilled in the art.
To generalize the matrix M, the number r of necessary check bits is first determined. Then, the matrix M used for the coding is built, so that the first r−2 elements of each column of even rank indicate, except for the first column, the rank of the couple to which the column belongs (a couple Ai of rank i is formed of the column of even rank 2i and of the column of odd rank 2i+1. The rank of the first column is 0, and that of the last columns is m−1. The last two elements of the columns of even rank are equal to “10”, except for the column of rank 0 and the column of rank m−2, where they are “01”. The first column of the matrix M may be formed of r−4 elements equal to “0”, followed by elements “1101”. Thus, in the first column of rank 0 in the matrix M, the first two rows are “0”s (r−4=6−4=2) and the elements in rows 2-5 are “1101.” The second column of the matrix M, which is the column of rank 1, may be formed of r−4 elements equal to “1” followed by the elements “111O”. Accordingly, the in the second column of the matrix M the first two rows are “1”s and the elements in rows 2-5 are “1110.” In the matrix M, the columns of odd rank are, except for the column of rank 1, complementary to the immediately preceding column of even rank. It should be noted that the last row of the matrix M is complementary to its penultimate line.
With regard to the matrix M, it should also be noted that the first r−2 elements of the first column of rank 0 may be identical to the r−2 elements of any other column of the matrix M (which is the case in the matrix M of FIG. 7A where the columns of rank 0 and rank 6 have the same elements “0011” in their first four (r−2) rows. This is true as long as the first column is different from all other columns of matrix M and the first four elements of the first column must not be all “0s” and must include more than one “1” so that the column is different from the columns of the matrix M′ used upon decoding which correspond to the check bits (i.e., the columns of rank 16-20 corresponding to the identity matrix A in FIG. 7B).
To form the matrix M′ used for decoding, the parity control matrix M is used and completed to the right by a square sub-matrix R of dimension rxr. The sub-matrix R includes “1s” on its main diagonal from upper left to lower right and “0s” everywhere else except in its last row, where the elements are the complement of those of the penultimate row of the sub-matrix R. The last row of the sub-matrix R thus includes “1s” everywhere except at the penultimate column.
The code using matrixes M and M′ has a minimum code distance equal to four, which enables correcting one error and detecting two errors. Upon decoding, the obtained syndrome S has r components. A total parity bit P is obtained by adding modulo 2 the last two syndrome components. If the syndrome S is the zero vector, there is no error in the data word X or check bits C. If the syndrome S is different from the zero vector and the total parity bit is equal to “1”, there is a single error. This error is easily corrected since the syndrome S corresponds to the matrix column having had its elements multiplied by the erroneous bit. If the syndrome is different from the zero vector and the total parity bit is equal to “0”, two errors are present and, while detected, cannot be corrected.
FIG. 10, as an example, illustrates a matrix M′32 used to decode 32-bit data words. The matrix M′32 has dimensions 7×39, and its first 32 columns correspond to the matrix M32 used upon coding. The matrices M32 and M′32 are formed on the model of what has been previously described. The corresponding coding and decoding circuits, not shown, are easily deduced from matrixes M32 and M′32 by means of the principles defined in relation with FIGS. 8A-8C and 9.
Any row permutation in a parity control matrix formulated according to this process may be utilized Similarly, any column permutation in such a matrix may also be done provided that at least two consecutive columns remain complementary. The number N of bits of the word to be coded may be even or odd. If the number N is odd, a matrix M such as described above with an even m equal to N+1 may first be formed, and then the matrix N to be used upon coding can easily derive from matrix M by suppression of any column, such as the first column.
Typically the ECC logic 4 (FIG. 1) that implements the matrices M and M′ is performed on the data word X of the width used by the application. A problem with using Hamming codes on relatively short words is that a larger percentage of storage capacity is required for the check bits. For example, if the application utilizes 8-bit data words, then 5 check bits are required for the SECDED logic executed by the ECC logic 4, which accounts for 62% of the total memory storage capacity. A 256-bit word, however, requires only 10 check bits for SECDED logic, which is only 4% of the memory storage capacity. Thus, there is a need for applying wide data words X to the ECC logic 4 to minimize the percentage of overall memory that is used by the codes generated by the ECC logic.
In the matrix M of FIG. 7A, the first two columns are not complementary. This is contrary to the one of the primary goals of this matrix, which is uniform density of “1s” and “0s” so that the distribution and operation of the adders Gi,j is improved. Particularly when the ECC logic 4 operates on wide data words X, uniform density is even more important to the large number of bits in each data word and the potential for delays caused by additional adders Gi,j, as well as the improved physical layout of the adders that is possible when the density of the “1s” and “0s” is uniform.
Another issue when dealing with wide data words X using the matrix M is the number of gates and adders Gi,j needed to implement encoding matrix M and decoding matrix M′. There is a particular need to minimize the number of components in ECC logic 4 operating on wide data words X in order to conserve space on semiconductor memory chips in which such circuits must be formed, and to reduce the costs associated with the manufacture of such chips.
There is a need for a parity control matrix for encoding and decoding wide data words and that allows for the formation of ECC logic having a reduced number of components and having relatively uniform distribution of such components to improve operation of such logic.